package com.gw2.gw2world.controller;

import com.gw2.gw2world.R;
import com.gw2.gw2world.model.Event;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class ActiveEventAdapter extends ArrayAdapter<Event> {

	public ActiveEventAdapter(Context context, Event[] objects) {
		super(context, android.R.layout.simple_list_item_1, objects);
	}
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		if(convertView==null) {
			LayoutInflater inflater = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
			convertView = inflater.inflate(R.layout.active_event_line, parent, false);
		}
		TextView tv_name = (TextView)convertView.findViewById(R.id.tv_ae_name);
		//TextView tv_flag = (TextView)convertView.findViewById(R.id.tv_ae_flag);
		//TextView tv_server=(TextView)convertView.findViewById(R.id.tv_ae_server);
		tv_name.setText(getItem(position).name);
		return super.getView(position, convertView, parent);
	}
}
